/**
 * Title:		T05Concurrent3Frog.java
 * Description: Test program for concurrency
 * 
 * @version		1.0 May 2009
 * @author		Hidemitsu Izawa (hi2136@columbia.edu)
 */
import kfrog.Frog;
import kfrog.Pond;

public class T05Concurrent3Frog {
	public static void main(String args[]){
		/** pond */
		Pond pond = new Pond(900,700);//"pondsize" command in KFrog
		pond.setPondColor("WHITE");//"pondcolor" command in KFrog
		
		/** frog1 circle*/
		Frog frog1 = new Frog(pond,1);//"new frog" command in KFrog
		frog1.frogcolor("BLUE");//"frogcolor" command in KFrog
		frog1.speed(5);//"speed" command in KFrog. 1:slow <-> 5:fast
		frog1.move(150, 550); //"goto" command in KFrog
		frog1.startdraw();//"startdraw" command in KFrog
		frog1.rightcurve(100, 360);//"rightcurve" command in KFrog
		frog1.stopdraw();//"enddraw" command in KFrog
		Thread FROG1 = new Thread(frog1);// end of "new frog" command in KFrog
		FROG1.start();// end of "new frog" command in KFrog
		
		/** frog2 triangle*/
		Frog frog2 = new Frog(pond,2);//"new frog" command in KFrog
		frog2.frogcolor("GREEN");//"frogcolor" command in KFrog
		frog2.speed(5);//"speed" command in KFrog. 1:slow <-> 5:fast
		frog2.move(250, 150); //"goto" command in KFrog
		frog2.startdraw();//"startdraw" command in KFrog
		for(int i=0;i<3;i++){
			frog2.forward(300);//"forward" command in KFrog
			frog2.turnleft(120);//"turnleft" command in KFrog
			frog2.sleep(2000);//"sleep" command in KFrog
		}
		frog2.stopdraw(); //"enddraw" command in KFrog
		Thread FROG2 = new Thread(frog2);// end of "new frog" command in KFrog
		FROG2.start();// end of "new frog" command in KFrog
		
		/** frog3 rectangle*/
		Frog frog3 = new Frog(pond,3);//"new frog" command in KFrog
		frog3.frogcolor("RED");//"frogcolor" command in KFrog
		frog3.speed(5);///"speed" command in KFrog. 1:slow <-> 5:fast
		frog3.move(550, 550);//"goto" command in KFrog
		frog3.startdraw();//"startdraw" command in KFrog
		for(int i=0;i<4;i++){
			frog3.forward(200);//"forward" command in KFrog
			frog3.turnright(90);//"turnleft" command in KFrog
			frog3.sleep(1000);//"sleep" command in KFrog
		}
		frog3.stopdraw();//"enddraw" command in KFrog
		Thread FROG3 = new Thread(frog3);// end of "new frog" command in KFrog
		FROG3.start();// end of "new frog" command in KFrog
	}
}
